package cn.chrisx.drad;

import java.util.HashMap;
import java.util.Map;

import cn.chrisx.drad.core.DrAdPlatform;

/**
 * @author Jzfox <jz_boy@163.com>
 * @version 1.0
 * @date 2018/9/25 11:40
 * @description
 * @copyright ©2018 www.jzfox.net All rights reserved.
 */
public class DrAdSdk {

    private static final Map<String, DrAdPlatform> PLATFORMS = new HashMap<>();

    public static final boolean DEV_DEBUG = BuildConfig.DEBUG;

    private static boolean debug = DEV_DEBUG;

    public static void setDebug(boolean b) {
        debug = b;
    }

    public static boolean isDebug() {
        return debug;
    }

    public static void registerAdPlatform(DrAdPlatform platform) {
        PLATFORMS.put(platform.name(), platform);
    }

    public static DrAdPlatform findPlatform(String name) {
        return PLATFORMS.get(name);
    }

    private DrAdSdk() {
    }
}
